package com.vzoom.logdesensitization.util;

public class StarUtil {
    private static final String[] STAR_ARRAY = {
            "",
            "*",
            "**",
            "***",
            "****",
            "*****",
            "******",
            "*******",
            "********",
            "*********",
            "**********",
            "***********",
            "************",
            "*************",
            "**************",
            "***************",
            "****************",
            "*****************",
            "******************",
            "*******************",
            "********************",
            "*********************",
            "**********************",
            "***********************",
            "************************",
            "*************************",
            "**************************",
    };

    public static String getStar(int index) {
        int maxIndex = index;
        if (index < 0) {
            maxIndex = 0;
            return STAR_ARRAY[maxIndex];
        }
        if (index > 26) {
            maxIndex = 26;
        }
        return STAR_ARRAY[maxIndex];
    }
}
